import * as types from '../types'
const user = {
  state: {
    avatar: null,
    name: null,
    id: null,
    token: null,
    levelId: null
  },
  mutations: {
    setUser (state, user) {
      Object.assign(state, user)
    }
  },
  actions: {
    setUser ({ commit }, user) {
      commit(types.SET_USER, user)
    }
  }
}

export default user
